package myblog.action;

import java.util.ArrayList;
import java.util.List;

import myblog.service.FavoriteService;
import myblog.vo.FavoriteVo;


import com.opensymphony.xwork2.ActionSupport;

public class FavoriteAction extends ActionSupport {
	private FavoriteService service;

	private List<FavoriteVo> favoriteList = new ArrayList<FavoriteVo>();

	private FavoriteVo favorite = null;

	private String favoriteid;

	public String list() {

		favoriteList = service.list();

		return "list";
	}

	public String del() {

		service.delFavorite(favoriteid);

		return "list";
	}

	public String add() {

		service.addFavorite(favorite);

		return "list";
	}

	public void setService(FavoriteService service) {
		this.service = service;
	}

	public List<FavoriteVo> getfavoriteList() {
		return favoriteList;
	}

	public void setfavoriteList(List<FavoriteVo> favoriteList) {
		this.favoriteList = favoriteList;
	}

	public FavoriteVo getfavorite() {
		return favorite;
	}

	public void setfavorite(FavoriteVo favorite) {
		this.favorite = favorite;
	}

	public String getfavoriteid() {
		return favoriteid;
	}

	public void setfavoriteid(String favoriteid) {
		this.favoriteid = favoriteid;
	}

}
